<template>
  <div class="commission_detail-container">
    <breadcrumb style="position: absolute;width:100%;"></breadcrumb>
    <img src="../../img/return_icon.png" alt @click="$router.go(-1)">

    <div class="content">
      <!-- <div class="query">
      </div> -->
      <div class="table" >
        <el-table :data="detailList" style="width: 100%" height="528">
          <el-table-column prop="price" label="红包金额(元)"></el-table-column>
          <el-table-column prop="note" label="变更原因"></el-table-column>
          <el-table-column prop="orderNo" label="订单号"></el-table-column>
          <!-- <el-table-column prop="sysTime" label="备注"></el-table-column> -->
          <el-table-column prop="creatTime" label="变更时间"></el-table-column>
        </el-table>
        <pagination
          :currentPage="currentPage"
          :page="page"
          :total="total"
          :pageSize="pageSize"
          @change-current="currentChange"
          @change-size="sizeChange"
        ></pagination>
      </div>
    </div>
  </div>
</template>

<script>
import breadcrumb from "../../components/breadcrumb";
import pagination from "../../components/page";
import {commission_detail} from '../../api/getData'
export default {
  components: { breadcrumb, pagination },
  data() {
    return {
      page: 1,
      id: this.$route.query.id,
      currentPage: 1,
      pageSize: 10,
      total: 0,
      username: "",
      startTime:'',
      endTime:'',
      levelOneNum:'',
      levelTwoNum:'',
      commissionSum:'',
      detailList: [],
      list:true,//提现明细的显示和影藏
      lists:false,//佣金获得明细的显示和隐藏
    };
  },
  created() {
    this.get_commission_detail()
  },
  methods: {
    sizeChange(val) {
      this.pageSize = val;
      this.currentPage = 1;
      this.get_commission_detail()
    },
    currentChange(val) {
      this.currentPage = val;
      this.get_commission_detail()

    },
    get_commission_detail(currentPage){
      if(currentPage){
        this.currentPage = currentPage
      }
    //  let data = 'endTime=' + this.endTime + "&startTime=" + this.startTime + '&userId=' + this.userId + '&size=' + this.pageSize + '&current=' + this.currentPage
      // commission_detail(data).then(res => {
      //   //console.log(res,'单个')
      //   if(res.data.status == 0 && res.data.data.records.length != 0){
      //     this.total = res.data.data.total 
      //     this.page = Math.ceil(this.total / this.pageSize)
      //     this.detailList = res.data.data.records
      //     this.levelOneNum = res.data.data.records[0].levelOneNum
      //     this.levelTwoNum=res.data.data.records[0].levelTwoNum
      //     this.commissionSum =res.data.data.records[0].commissionSum
      //   }
      // })
     // let id="id="+this.id
     let data={
       size:this.pageSize,
       current:this.currentPage
     }
    //  let data="size="+this.pageSize+"&current="+this.currentPage+"&id="+this.id
      this.$axios.post('/web_red_packet/detail?id='+this.id+'&chooseType='+3,data).then(res=>{
        this.total=res.data.data.total
        this.page=Math.ceil(this.total/this.pageSize)
        this.detailList=res.data.data.records
        //console.log(res)
      })
    },
    //控制提现明细的显示和
  }
};
</script>


<style lang="less" >
.commission_detail-container {
  @import "../../style/table.less";
  @import "../../style/content.less";
  display: flex;
  flex-flow: column;
  position: relative;
  height: 100%;
  .el-table .cell {
    white-space: pre-line !important;
  }
  > img {
    position: absolute;
    width: 30px;
    height: 30px;
    top: 5px;
    right: 40px;
    z-index: 99;
    cursor: pointer;
  }
  .content {
    .query {
      .btn {
        .el-button {
          width: 70px;
        }
      }
      .start_time {
        display: flex;
        align-items: center;
      }
      .end_time {
        display: flex;
        align-items: center;
      }
    }
  }
}
</style>